//
//  PicImageViewCollectionViewCell.m
//  GLGW_Shoping
//
//  Created by yang on 2018/11/14.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "PicImageViewCollectionViewCell.h"

@interface PicImageViewCollectionViewCell ()
{
    GLGWButton * deletePicBut;
    GLGWImageView * goodsImage;
}
@end

@implementation PicImageViewCollectionViewCell
+(NSString *)cellIdentifier{
    return @"PicImageViewCollectionViewCell";
}

+ (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath{
    PicImageViewCollectionViewCell *cell = (PicImageViewCollectionViewCell*)[collectionView dequeueReusableCellWithReuseIdentifier:[PicImageViewCollectionViewCell cellIdentifier] forIndexPath:indexPath];
    return cell;
}

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        self.contentView.layer.cornerRadius = 3.0;
        self.contentView.layer.borderWidth = 1.0;
        self.contentView.layer.borderColor = [UIColor colorWithHexString:@"#CCCCCC"].CGColor;
        self.contentView.layer.masksToBounds = YES;
        //
        goodsImage = [[GLGWImageView alloc] initInSuperView:self.contentView];
        goodsImage.backgroundColor = kRandomColor;
        [goodsImage mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self.contentView).offset(0);
        }];
        //
        deletePicBut = [[GLGWButton alloc] initInSuperView:self.contentView];
        deletePicBut.image_Name = @"icon_lajitong_shanchu";
        deletePicBut.backgroundColor = [UIColor colorWithHexString:@"#000000" alpha:0.5];
        [deletePicBut mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.equalTo(self.contentView);
            make.bottom.equalTo(self.contentView.mas_bottom).offset(-kHeightProportion_In_iPhoneTriploid(22));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(29)));
        }];
    }
    return self;
}
@end
